package com.zyms.module.result;





import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class ResultObj {
    /**
     * 反馈状态
     */

    private Integer code;

    /**
     * 反馈信息
     */
    private String msg;

    /**
     * 反馈数据
     */
    private Object data;



    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public ResultObj() {
        super();
        this.code=ReturnCode.SUCCESSFULLY.getCode();
        this.msg=ReturnCode.SUCCESSFULLY.getMsg();
        // TODO Auto-generated constructor stub
    }

    public ResultObj(ReturnCode returnCode) {
        this.code = returnCode.getCode();
        this.msg = returnCode.getMsg();
    }
    public ResultObj(ReturnCode returnCode, Object data) {
        this.code = returnCode.getCode();
        this.msg = returnCode.getMsg();
        this.data = data;
    }

    public ResultObj(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }


   /* public String toJson() {
        return JsonHandler.objectToJson(this);
    }*/




    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
    
    public static void main(String[] args) {
    	List<Map> li = new ArrayList<Map>();
		Map map = new HashMap();
		map.put("asdf", 1234);
		map.put("55", 1234);
		map.put("tt", 1234);
		Map map1 = new HashMap();
		li.add(map);
		map1.put("list", li);
		//System.out.println(new ResultObj(1, "成功", map1).toJson());
	}
}
